<?php

/**		
 *	{{!xml}}
 *
 */

$str = $params[0]; // строка
$mode = isset($params['mode']) ? $params['mode'] : 'x'; // формат

switch ($mode) {
case 'cdata':
case 'CDATA':
	$str = '<![CDATA['.$str.']]>';
	break;

default:
	$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
	$str = strip_tags($str);
	$str = htmlspecialchars($str, ENT_QUOTES, 'UTF-8'); 
	break;
}
echo $str;

?>
